# Uncomment the next line to define a global platform for your project
  platform :ios, '13.0'
  inhibit_all_warnings!
  install! 'cocoapods', :disable_input_output_paths => true  

 source 'https://github.com/CocoaPods/Specs.git'

target 'WalkNovel' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks! :linkage => :static

  # Pods for WalkNovel
  pod 'Alamofire'
  pod 'HandyJSON'
  pod 'Moya/RxSwift'
  pod 'RxSwift'
  pod 'RxCocoa'
  pod 'Kingfisher'
  pod 'SnapKit'
  pod 'MJRefresh'
  pod 'MBProgressHUD'		
  pod 'LYEmptyView'
  pod 'KeychainAccess'
  pod 'ReachabilitySwift'
  pod 'SwiftyUserDefaults'
  pod 'SwiftyStoreKit'
  pod 'JXSegmentedView'
  pod 'JXPagingView/Paging'
  pod 'FLEX', :configurations => ['Debug']
  pod 'IQKeyboardManager'
  pod 'SkeletonView'
  pod 'TXScrollLabelView'
  pod 'GKPhotoBrowser'
  pod 'RealmSwift'
  pod 'Bugly'
  pod 'ChameleonFramework/Swift', :git => 'https://github.com/ViccAlexander/Chameleon.git' #颜色渐变
  pod 'lottie-ios'
  pod "Magnetic"
  pod 'DGCharts'
  pod 'JXBanner'
  pod 'RyukieSwifty/ScreenShield'
  pod 'StreamingKit'
  pod 'DTCoreText'
  
  # 海外
  pod 'GoogleSignIn'
      
  pre_install do |installer|
    remove_swiftui()
  end
end

def remove_swiftui
  # 解决 xcode13 Release模式下SwiftUI报错问题
  system("rm -rf ./Pods/Kingfisher/Sources/SwiftUI")
  code_file = "./Pods/Kingfisher/Sources/General/KFOptionsSetter.swift"
  code_text = File.read(code_file)
  code_text.gsub!(/#if canImport\(SwiftUI\) \&\& canImport\(Combine\)(.|\n)+#endif/,'')
  system("rm -rf " + code_file)
  aFile = File.new(code_file, 'w+')
  aFile.syswrite(code_text)
  aFile.close()
end


post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      if config.build_settings['WRAPPER_EXTENSION'] == 'com.zuihai.novel'
        config.build_settings['DEVELOPMENT_TEAM'] = 'M8X5485879'
      end
    end
  end
end
